/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.giant.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author taticay
 */
@Entity
@Table(name = "w_claim")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "WClaim.findAll", query = "SELECT w FROM WClaim w"),
    @NamedQuery(name = "WClaim.findByIdClaim", query = "SELECT w FROM WClaim w WHERE w.idClaim = :idClaim"),
    @NamedQuery(name = "WClaim.findByIdCatalog", query = "SELECT w FROM WClaim w WHERE w.idCatalog = :idCatalog"),
    @NamedQuery(name = "WClaim.findByIdClass", query = "SELECT w FROM WClaim w WHERE w.idClass = :idClass"),
    @NamedQuery(name = "WClaim.findByIdLine", query = "SELECT w FROM WClaim w WHERE w.idLine = :idLine"),
    @NamedQuery(name = "WClaim.findByIdBrand", query = "SELECT w FROM WClaim w WHERE w.idBrand = :idBrand"),
    @NamedQuery(name = "WClaim.findByFrameNo", query = "SELECT w FROM WClaim w WHERE w.frameNo = :frameNo"),
    @NamedQuery(name = "WClaim.findByFrameSize", query = "SELECT w FROM WClaim w WHERE w.frameSize = :frameSize"),
    @NamedQuery(name = "WClaim.findByIdClaimItem", query = "SELECT w FROM WClaim w WHERE w.idClaimItem = :idClaimItem"),
    @NamedQuery(name = "WClaim.findByClaimDescription", query = "SELECT w FROM WClaim w WHERE w.claimDescription = :claimDescription"),
    @NamedQuery(name = "WClaim.findByIdClaimStatus", query = "SELECT w FROM WClaim w WHERE w.idClaimStatus = :idClaimStatus"),
    @NamedQuery(name = "WClaim.findByWarrantyOrder", query = "SELECT w FROM WClaim w WHERE w.warrantyOrder = :warrantyOrder"),
    @NamedQuery(name = "WClaim.findByDateClaim", query = "SELECT w FROM WClaim w WHERE w.dateClaim = :dateClaim"),
    @NamedQuery(name = "WClaim.findByDateClosed", query = "SELECT w FROM WClaim w WHERE w.dateClosed = :dateClosed"),
    @NamedQuery(name = "WClaim.findByDateConfirm", query = "SELECT w FROM WClaim w WHERE w.dateConfirm = :dateConfirm"),
    @NamedQuery(name = "WClaim.findByHeight", query = "SELECT w FROM WClaim w WHERE w.height = :height"),
    @NamedQuery(name = "WClaim.findByWeight", query = "SELECT w FROM WClaim w WHERE w.weight = :weight"),
    @NamedQuery(name = "WClaim.findBySituationDesc", query = "SELECT w FROM WClaim w WHERE w.situationDesc = :situationDesc"),
    @NamedQuery(name = "WClaim.findByNotes", query = "SELECT w FROM WClaim w WHERE w.notes = :notes")})
public class WClaim implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_claim")
    private Integer idClaim;
    @OneToOne
    @JoinColumns({
        @JoinColumn(name = "id_brand",
        referencedColumnName = "id_brand", updatable = false,
        insertable = false)
    })
    private InBrand idBrand;
    @OneToOne
    @JoinColumns({
        @JoinColumn(name = "id_line",
        referencedColumnName = "id_line", updatable = false,
        insertable = false),
        @JoinColumn(name = "id_brand",
        referencedColumnName = "id_brand", updatable = false,
        insertable = false)
    })
    private InLine idLine;
    @OneToOne
    @JoinColumns({
        @JoinColumn(name = "id_brand",
        referencedColumnName = "id_brand", updatable = false,
        insertable = false),
        @JoinColumn(name = "id_line",
        referencedColumnName = "id_line", updatable = false,
        insertable = false),
        @JoinColumn(name = "id_class",
        referencedColumnName = "id_class", updatable = false,
        insertable = false)})
    private InClass idClass;
    @OneToOne
    @JoinColumns({
        @JoinColumn(name = "id_brand",
        referencedColumnName = "id_brand"),
        @JoinColumn(name = "id_line",
        referencedColumnName = "id_line"),
        @JoinColumn(name = "id_class",
        referencedColumnName = "id_class"),
        @JoinColumn(name = "id_catalog",
        referencedColumnName = "id_catalog")
    })
    private InCatalog idCatalog;
    @Basic(optional = false)
    @Column(name = "frame_no")
    private int frameNo;
    @Basic(optional = false)
    @Size(min = 1, max = 20)
    @Column(name = "frame_size")
    private String frameSize;
    @OneToOne
    @JoinColumns({
        @JoinColumn(name = "id_claim_item",
        referencedColumnName = "id_claim_item", updatable = false,
        insertable = false)
    })
    private WClaimItem idClaimItem;
    @Basic(optional = false)
    @Size(min = 1, max = 300)
    @Column(name = "claim_description")
    private String claimDescription;
    @OneToOne
    @JoinColumns({
        @JoinColumn(name = "id_claim_status",
        referencedColumnName = "id_claim_status", updatable = false,
        insertable = false)
    })
    private WClaimStatus idClaimStatus;
    @Size(max = 15)
    @Column(name = "warranty_order")
    private String warrantyOrder;
    @Basic(optional = false)
    @NotNull
    @Column(name = "date_claim")
    @Temporal(TemporalType.DATE)
    private Date dateClaim;
    @Column(name = "date_closed")
    @Temporal(TemporalType.DATE)
    private Date dateClosed;
    @Column(name = "date_confirm")
    @Temporal(TemporalType.DATE)
    private Date dateConfirm;
    @Basic(optional = false)
    @Column(name = "height")
    private int height;
    @Basic(optional = false)
    @Column(name = "weight")
    private int weight;
    @Basic(optional = false)
    @Size(min = 1, max = 500)
    @Column(name = "situation_desc")
    private String situationDesc;
    @Size(max = 300)
    @Column(name = "notes")
    private String notes;
    @Size(max = 11)
    @Column(name = "sku")
    private String sku;
    @Size(max = 20)
    @Column(name = "invoice_no")
    private String invoiceNo;
    @Column(name = "quantity")
    private int quantity;

    public WClaim() {
    }

    public WClaim(Integer idClaim) {
        this.idClaim = idClaim;
    }

    public WClaim(Integer idClaim, InCatalog idCatalog,
            InClass idClass, InLine idLine, InBrand idBrand, int frameNo, String frameSize, WClaimItem idClaimItem, String claimDescription, WClaimStatus idClaimStatus, Date dateClaim, int height, int weight, String situationDesc,
            String sku, String invoiceNo, int quantity) {
        this.idClaim = idClaim;
        this.idCatalog = idCatalog;
        this.idClass = idClass;
        this.idLine = idLine;
        this.idBrand = idBrand;
        this.frameNo = frameNo;
        this.frameSize = frameSize;
        this.idClaimItem = idClaimItem;
        this.claimDescription = claimDescription;
        this.idClaimStatus = idClaimStatus;
        this.dateClaim = dateClaim;
        this.height = height;
        this.weight = weight;
        this.situationDesc = situationDesc;
        this.sku = sku;
        this.invoiceNo = invoiceNo;
        this.quantity = quantity;
    }

    public Integer getIdClaim() {
        return idClaim;
    }

    public void setIdClaim(Integer idClaim) {
        this.idClaim = idClaim;
    }

    public InCatalog getIdCatalog() {
        return idCatalog;
    }

    public void setIdCatalog(InCatalog idCatalog) {
        this.idCatalog = idCatalog;
    }

    public InClass getIdClass() {
        return idClass;
    }

    public void setIdClass(InClass idClass) {
        this.idClass = idClass;
    }

    public InLine getIdLine() {
        return idLine;
    }

    public void setIdLine(InLine idLine) {
        this.idLine = idLine;
    }

    public InBrand getIdBrand() {
        return idBrand;
    }

    public void setIdBrand(InBrand idBrand) {
        this.idBrand = idBrand;
    }

    public int getFrameNo() {
        return frameNo;
    }

    public void setFrameNo(int frameNo) {
        this.frameNo = frameNo;
    }

    public String getFrameSize() {
        return frameSize;
    }

    public void setFrameSize(String frameSize) {
        this.frameSize = frameSize;
    }

    public WClaimItem getIdClaimItem() {
        return idClaimItem;
    }

    public void setIdClaimItem(WClaimItem idClaimItem) {
        this.idClaimItem = idClaimItem;
    }

    public String getClaimDescription() {
        return claimDescription;
    }

    public void setClaimDescription(String claimDescription) {
        this.claimDescription = claimDescription;
    }

    public WClaimStatus getIdClaimStatus() {
        return idClaimStatus;
    }

    public void setIdClaimStatus(WClaimStatus idClaimStatus) {
        this.idClaimStatus = idClaimStatus;
    }

    public String getWarrantyOrder() {
        return warrantyOrder;
    }

    public void setWarrantyOrder(String warrantyOrder) {
        this.warrantyOrder = warrantyOrder;
    }

    public Date getDateClaim() {
        return dateClaim;
    }

    public void setDateClaim(Date dateClaim) {
        this.dateClaim = dateClaim;
    }

    public Date getDateClosed() {
        return dateClosed;
    }

    public void setDateClosed(Date dateClosed) {
        this.dateClosed = dateClosed;
    }

    public Date getDateConfirm() {
        return dateConfirm;
    }

    public void setDateConfirm(Date dateConfirm) {
        this.dateConfirm = dateConfirm;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public String getSituationDesc() {
        return situationDesc;
    }

    public void setSituationDesc(String situationDesc) {
        this.situationDesc = situationDesc;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idClaim != null ? idClaim.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof WClaim)) {
            return false;
        }
        WClaim other = (WClaim) object;
        if ((this.idClaim == null && other.idClaim != null)
                || (this.idClaim != null && !this.idClaim.equals(other.idClaim))) {
            return false;
        }
        return true;
    }

    public String getSku() {
        return sku;
    }

    public void setSku(String sku) {
        this.sku = sku;
    }

    public String getInvoiceNo() {
        return invoiceNo;
    }

    public void setInvoiceNo(String invoiceNo) {
        this.invoiceNo = invoiceNo;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    @Override
    public String toString() {
        return "com.giant.entities.WClaim[ idClaim="
                + idClaim + " ]";
    }
}
